#include <cstdio>

int n, k, len[100010];

/**
 * t是要切成的小段木头的长度
 */
int isok(int t){
    int num = 0, i;
    //循环所有的木头
    for (i = 0; i < n; i++) {
        if (num>=k) break;
        num  = num + len[i]/t;
    }
    if (num<k) return 1;
    else return 0;
}

/**
 * CPSJ2005年初赛28题
 * 输入样例:
	3 7
	232
	124
	456
   输出样例:
	114

    测试链接：
    https://www.luogu.com.cn/problem/P2440

 */
int main() {
    int i,left,right,mid;
    scanf("%d%d", &n, &k);
    right = 0;
    for (i = 0; i < n; i++) {
        scanf("%d", &(len[i]));
        if (right < len[i]) right = len[i];
    }
    //right是最长的木头+1
    right++;
    left=0;
    while (left+1 < right)
    {
    	//取中间值
        mid = (left + right) / 2;
        if (isok(mid)) right = mid;
        else left = mid;
    }
    printf("%d\n", left);
    return 0;
}
